/*
 * $Id: CfgSystemLoadParam.java,v 1.5 2009/10/30 22:10:47 navdeep_mahajan Exp $
 *
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 *
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */

package com.ge.healthcare.autosc.common.database.pojo;

import com.ge.healthcare.autosc.common.load.IResourceType;
import com.ge.healthcare.autosc.common.load.ResourceType;

public class CfgSystemLoadParam extends AbstractCfgSystemLoadParam {
	/**
	 * Eclipse generated
	 */
	private static final long serialVersionUID = -7300902276021933800L;
	public static final String TABLE_NAME = "com.ge.healthcare.autosc.common.database.pojo.CfgSystemLoadParam";
	public static final String COL_TYPE = "type";

	public static final String TYPE_CATIGORY = "TASK_CATIGORY";
	public static final String TYPE_PORTMASTER = "PORT_MASTER";
	public static final String TYPE_SVC_CENTER = "SVC_CENTER";

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("{System Load Param Id=").append(this.getSystemLoadParamId())
				.append("},");
		sb.append("{Name  =").append(this.getName()).append("},");
		sb.append("{Type  =").append(this.getType()).append("},");
		sb.append("{Value =").append(this.getValue()).append("},");
		sb.append("{Expiration Duration =").append(this.getExpireDuration())
				.append("}");
		return sb.toString();
	}

	public IResourceType createResourceLoadType() {
		int max = this.getValue().intValue();
		IResourceType resource = new ResourceType(max, this.getExpireDuration()
				.intValue());
		return resource;
	}

	public IResourceType createResourceLoadType(int multiplier) {
		int max = this.getValue().intValue();
		IResourceType resource = new ResourceType(max * multiplier, this
				.getExpireDuration().intValue());
		return resource;
	}
}
